﻿<%@ Page Title="Додати сферу  діяльності" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Insert.aspx.cs" Inherits="Work.UI.Web.Forms.Admin.Section.Insert" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="contentHeader" runat="server">
Додати сферу  діяльності
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <asp:ObjectDataSource ID="odsSection" runat="server" 
        onobjectcreating="odsSection_ObjectCreating"
        TypeName="Work.BL.Hibernate.Managers.HSectionManager"
        DataObjectTypeName="Work.BL.POCOs.SectionPOCO"         
        InsertMethod="Insert">        
    </asp:ObjectDataSource>


    <asp:FormView ID="frvSection" runat="server"
        DataSourceID="odsSection"
        DataKeyNames="Id" DefaultMode="Insert" 
        oniteminserted="frvProject_ItemInserted">
        
        <InsertItemTemplate>

            <table class="addEdit">            
                <tbody>
                    <tr>
                        <th>Name</th>
                        <td>
                            <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("Name") %>' />
                                <asp:RequiredFieldValidator ID="rfvCity" runat="server" 
                                        ErrorMessage="Required field" 
                                        ControlToValidate="txtName" 
                                        ValidationGroup="Section" 
                                        Display="Dynamic" />
                                <asp:RegularExpressionValidator ID="revName" runat="server" 
                                        ErrorMessage="Length should not exceed 50"                                                                                                             
                                        ControlToValidate="txtName"
                                        ValidationGroup="Section" 
                                        ValidationExpression=".{1,50}"
                                        Display="Dynamic" />
                        </td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="2">
                            <asp:LinkButton ID="btnSave" runat="server" onclick="btnSave_Click"
                                CausesValidation="true" ValidationGroup="Section" CssClass="button1" >
                                <strong>Save</strong>
                            </asp:LinkButton>
                            
                            <asp:LinkButton ID="btnCancel" runat="server" onclick="btnCancel_Click"
                                CausesValidation="false" CssClass="button1">    
                                <strong>Cansel</strong>
                            </asp:LinkButton>
                        </td>
                    </tr>
                </tfoot>
            </table>

        </InsertItemTemplate>

    </asp:FormView>

</asp:Content>
